<?php use_helper('Object') ?>

<h1>Software Verwaltung</h1>
<ul id="nav-left">
<?php foreach ($categories as $category): ?>
   <?php if(!empty($request_id) && $request_id == $category->getId()): ?>
   <li class="active"><?php echo link_to('&raquo; '.$category->getName(), 'softwareservices/showOverview?id='.$category->getId().'&view=listSoftware') ?> (<?php echo link_to('E', 'softwareservices/showOverview?id='.$category->getId().'&view=editCategory') ?>)
   <?php $selected_category = $category;  ?>
   <?php else: ?>
   <li><?php echo link_to('&raquo; '.$category->getName(), 'softwareservices/showOverview?id='.$category->getId().'&view=listSoftware') ?> (<?php echo link_to('E', 'softwareservices/showOverview?id='.$category->getId().'&view=editCategory') ?>)
   <?php endif; ?>
</li>      
<?php endforeach; ?>
</ul>
<div id="content-right">
<?php if ($sf_flash->has('errMessage')): ?>
  <div class="message"><?php echo $sf_flash->get('errMessage') ?></div>
<?php endif; ?>

<?php if($request_view == 'editCategory'): ?>
<?php include_partial('editCategory', array('category' => $selected_category)) ?>
<?php endif; ?>
<?php if($request_view == 'listSoftware'): ?>
<?php include_partial('listSoftware', array('software' => $software, 'request_id' => $request_id)) ?>
<?php endif; ?>
<?php if($request_view == 'editSoftware'): ?>
<?php include_partial('editSoftware', array('software_item' => $selected_software, 'request_id' => $request_id, 'request_sid' => $request_sid)) ?>
<?php endif; ?>
</div>
<div class="clear"></div>

<fieldset>
<legend>Funktionen</legend>

<?php echo link_to('Kategorie hinzufügen', 'softwareservices/showOverview?view=editCategory') ?>
<?php if(!empty($request_id)): ?>
|<?php echo link_to('Software hinzufügen', 'softwareservices/showOverview?id='.$selected_category->getId().'&view=editSoftware') ?>
<?php endif; ?>
</fieldset>